import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import local_get from '@dfeidao/atom-web/local/get';
import fire_to from '@dfeidao/atom-web/msg/fire';
import error from '@dfeidao/atom-web/msgbox/error';

// 点击功能控制点新增
export default async function a005(fd: IFeidaoAiBrowserComponent) {
	const pub_package = local_get(fd, "pub_package") as { no: string };
	const data = local_get(fd, "data") as Array<{ code: string }>;
	if (local_get(fd, "pub_package")) {
		const codes = new Array();
		if (data) {
			Array.from(data).forEach((a) => {
				codes.push(a.code);
			});
		}
		fire_to('zj-000005', 'a001', { package_no: pub_package.no, codes, sort: "inst" });
	} else {
		error('请先选择一个页面');
	}
}
